home *** CD-ROM | disk | FTP | other *** search
- import java.io.ByteArrayInputStream;
- import java.io.ByteArrayOutputStream;
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
-
- class Type {
- // $FF: renamed from: id int
- private int field_0;
- private String name;
-
- Type(int id, String name) {
- this.field_0 = id;
- this.name = name;
- }
-
- Type(String name) {
- this(0, name);
- }
-
- Type(byte[] vec) {
- this.initialize(vec);
- }
-
- String getName() {
- return this.name;
- }
-
- int getId() {
- return this.field_0;
- }
-
- void setId(int idVal) {
- this.field_0 = idVal;
- }
-
- void initialize(byte[] vec) {
- ByteArrayInputStream bais = null;
- DataInputStream dis = null;
-
- try {
- bais = new ByteArrayInputStream(vec);
- dis = new DataInputStream(bais);
- this.field_0 = dis.readInt();
- this.name = dis.readUTF();
- } catch (IOException var14) {
- ((Throwable)var14).printStackTrace();
- } finally {
- try {
- bais.close();
- dis.close();
- } catch (IOException var13) {
- ((Throwable)var13).printStackTrace();
- }
-
- }
-
- }
-
- byte[] toBytes() {
- byte[] data = null;
- ByteArrayOutputStream baos = null;
- DataOutputStream dos = null;
-
- try {
- baos = new ByteArrayOutputStream();
- dos = new DataOutputStream(baos);
- dos.writeInt(this.field_0);
- dos.writeUTF(this.name);
- data = baos.toByteArray();
- } catch (Exception var14) {
- ((Throwable)var14).printStackTrace();
- } finally {
- try {
- baos.close();
- dos.close();
- } catch (IOException var13) {
- ((Throwable)var13).printStackTrace();
- }
-
- }
-
- return data;
- }
- }
-